# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MyBusinessAccountManagement.V1.Model.Account do
  @moduledoc """
  An account is a container for your location. If you are the only user who manages locations for your business, you can use your personal Google Account. To share management of locations with multiple users, [create a business account] (https://support.google.com/business/answer/6085339?ref_topic=6085325).

  ## Attributes

  *   `accountName` (*type:* `String.t`, *default:* `nil`) - Required. The name of the account. For an account of type `PERSONAL`, this is the first and last name of the user account.
  *   `accountNumber` (*type:* `String.t`, *default:* `nil`) - Output only. Account reference number if provisioned.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The resource name, in the format `accounts/{account_id}`.
  *   `organizationInfo` (*type:* `GoogleApi.MyBusinessAccountManagement.V1.Model.OrganizationInfo.t`, *default:* `nil`) - Output only. Additional info for an organization. This is populated only for an organization account.
  *   `permissionLevel` (*type:* `String.t`, *default:* `nil`) - Output only. Specifies the permission level the user has for this account.
  *   `primaryOwner` (*type:* `String.t`, *default:* `nil`) - Required. Input only. The resource name of the account which will be the primary owner of the account being created. It should be of the form `accounts/{account_id}`.
  *   `role` (*type:* `String.t`, *default:* `nil`) - Output only. Specifies the AccountRole of this account.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Required. Contains the type of account. Accounts of type PERSONAL and ORGANIZATION cannot be created using this API.
  *   `verificationState` (*type:* `String.t`, *default:* `nil`) - Output only. If verified, future locations that are created are automatically connected to Google Maps, and have Google+ pages created, without requiring moderation.
  *   `vettedState` (*type:* `String.t`, *default:* `nil`) - Output only. Indicates whether the account is vetted by Google. A vetted account is able to verify locations via the VETTED_PARTNER method.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountName => String.t() | nil,
          :accountNumber => String.t() | nil,
          :name => String.t() | nil,
          :organizationInfo =>
            GoogleApi.MyBusinessAccountManagement.V1.Model.OrganizationInfo.t() | nil,
          :permissionLevel => String.t() | nil,
          :primaryOwner => String.t() | nil,
          :role => String.t() | nil,
          :type => String.t() | nil,
          :verificationState => String.t() | nil,
          :vettedState => String.t() | nil
        }

  field(:accountName)
  field(:accountNumber)
  field(:name)
  field(:organizationInfo, as: GoogleApi.MyBusinessAccountManagement.V1.Model.OrganizationInfo)
  field(:permissionLevel)
  field(:primaryOwner)
  field(:role)
  field(:type)
  field(:verificationState)
  field(:vettedState)
end

defimpl Poison.Decoder, for: GoogleApi.MyBusinessAccountManagement.V1.Model.Account do
  def decode(value, options) do
    GoogleApi.MyBusinessAccountManagement.V1.Model.Account.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MyBusinessAccountManagement.V1.Model.Account do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
